/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019-12-31 11:16:32
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 查询组织列表
export const getComOrgList = params => axios.get(`${SERVER.GMSCLOUD_MANAGE}/company/org`, { params });
// 查询组织树列表
export const getComOrgTreeList = params => axios.get(`${SERVER.GMSCLOUD_MANAGE}/company/org/tree`, { params });
// 保存
export const saveComOrgList = params => axios.post(`${SERVER.GMSCLOUD_MANAGE}/company/org`,  params );
// 编辑保存
export const editSaveComOrgList = (params, id) => axios.put(`${SERVER.GMSCLOUD_MANAGE}/company/org/${id}`, params);
// 获取部门树
export const getOrgsTree = params => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/basedata/orgs/getIsValid/Orgs`, params);
//查询组织树数据
export const getChildOrgTreeList = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/org/tree`, { params });
//查询明细
export const getChildOrgdetail = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/org/detail`, { params });
//获取品牌
export const getOrgBrand = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/org/getOrgBrand`, { params });
//获取车系
export const getOrgSeries = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/org/getOrgSeries`, { params });
//保存
export const saveOrgInfo = params => axios.put(`${SERVER.DMSCLOUD_BASEDATA}/org/save`, params);
//是否是销售
export const isSale = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerInfo/dealer/orgs`);
